<?php

/*

  Action - Attack	$5

  +2 Cards
  Each other player gains a Curse card.

 */

class Witch extends Card implements iAction, iKingdom, iAttack, iBasic {

    public function __construct() {
        parent::__construct("Witch", 5);
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+2 Cards",
            "Each other player gains a Curse card.");
    }
    
        public function getDisplayName($quantity = 1) {
        if ($quantity == 1) {
            return "Witch";
        }
        return $quantity." Witches";
    }
    
    public function play(Game $game, $isRealCard) {
        $drawed_cards = $game->drawCards(2);
         ScreenDisplay::addScreenMessage($game, true, "draw ".  nicePrint($drawed_cards), "draws ".sizeof($drawed_cards). " cards");
        
        $game->attack($this);
        
        $names = $game->getOtherPlayersNames(true);
        foreach ($names as $name) {
            $curse = $game->moveCardFromPileToPile("Curse", BoardCards, DiscardPile, $name);
             ScreenDisplay::addScreenMessage($game, true, "gain  ".  nicePrint($curse), "gains ". ScreenDisplay::$LMSG , $name);
        }
        $game->cardActionFinished();
        return true;
    }

}

?>